\input{preambule}
\input{version}
\usepackage[
    type={CC},
    modifier={by},
    version={4.0},
]{doclicense}

\title{The Lustre V6 Grammar Rules}
\author{Erwan Jahier, Pascal Raymond, Nicolas Halbwachs}

\date{
Software Version: \version{}
 (\versiondate) }


\begin{document}

%\maketitlepage
\maketitle

\doclicenseThis
\newpage
\newcommand{\lsx}[1]{{   \bf $\langle$\mbox{\it \hyperlink{#1}{#1}$\rangle$}}}
\newcommand{\lsxDef}[1]{{\bf $\langle$\mbox{\it \hypertarget{#1}{#1}$\rangle$}}}
\newcommand{\mygrammar}[1]{
%  \begin{grammarrule}
    \begin{longtable}{lrl}
      #1
    \end{longtable}
%  \end{grammarrule}
}



\input{lv6parser}
We recall that grammar  rules  are  given  using   an  extended  BNF  notation,  where
non-terminals  are written  \lsxDef{like\_this} and  terminals \lx{like
  that}.  All non-terminals (should) have pdf internal links to ease the reading.


\begin{itemize}
\item
One-line comments start with \key{--} and  stop at the the end of the
line.
\item
Multi-line comments start with '\key{(*}'  and end at the next following
'\key{*)}' ('\key{/*}' and '\key{*/}' also work). 
Multi-line comments cannot be nested.
\item \bnfleftident{TK\_IDENT} stands for identifier: \bnftoken{[\_a-zA-Z][\_a-zA-Z0-9]*}
\item \bnfleftident{TK\_LONGIDENT} stands for pointed (or long)
identifier, that  is, two identifiers separated by a double colon:
\bnfleftident{TK\_IDENT}\bnftoken{::}\bnfleftident{TKIDENT}
% \bnftoken{[\_a-zA-Z][\_a-zA-Z0-9]*}\bnftoken{::}\bnftoken{[\_a-zA-Z][\_a-zA-Z0-9]*} ,
\end{itemize}



% so that links remain inside the appendix
\gdef\bnfleftident#1{%
  \bf $\langle$\mbox{\it \hypertarget{alt#1}{#1}$\rangle$}
  }%
\gdef\bnfrightident#1{%
  {\bf $\langle$\mbox{\it \hyperlink{alt#1}{#1}$\rangle$}}
  }%

\ebnftable

\end{document}
